home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_9127.txt < prev    next >
Text File  |  1989-02-26  |  8KB  |  263 lines

  1. -- card: 9127 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13187
  5. -- name: Scrolling Text Button 2
  6. ----- HyperTalk script -----
  7. on closecard
  8.   put empty into card field result
  9. end closecard
  10.  
  11.  
  12. -- part 1 (field)
  13. -- low flags: 01
  14. -- high flags: 0000
  15. -- rect: left=68 top=308 right=325 bottom=212
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 0 / 0
  18. -- text alignment: 0
  19. -- font id: 3
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: Result
  24.  
  25.  
  26. -- part 4 (field)
  27. -- low flags: 00
  28. -- high flags: 4007
  29. -- rect: left=57 top=70 right=299 bottom=491
  30. -- title width / last selected line: 0
  31. -- icon id / first selected line: 0 / 0
  32. -- text alignment: 0
  33. -- font id: 3
  34. -- text size: 9
  35. -- style flags: 0
  36. -- line height: 12
  37. -- part name: 
  38. ----- HyperTalk script -----
  39. COMMAND CLICK on any word in this script for an example of how this script works.
  40.  
  41. -- The BMUG/UNSOM trick by Guy Kuo and Raines Cohen - December 14,1987
  42. -- Use this script freely but please retain the above credit
  43. --
  44. -- The BMUG trick by Raines Cohen
  45. --         fused with the
  46. -- UNSOM technique by Guy Kuo
  47. --
  48. -- Recombinant code?  Script splicing?  Naw, just HyperCard letting
  49. -- ideas grow together.  Here is how this one works.
  50. --
  51. -- If the commandKey is down, we're in danger of doing a text button
  52. -- Check if the msg box has already been moved off the screen.
  53. -- If it hasnt hide the msg box by moving it off the screen and
  54. -- remember the old msg box location in MsgLoc
  55. -- the msg visibility in msgVis, and the msg in msgContent
  56. -- This allows us to restore things back to the way they were when
  57. -- we are done.
  58. -- If the msg box has been moved off the screen and msg is not
  59. -- empty, the user has command selected something and it is in msg
  60. -- do something with msg.  In this example we put it into another
  61. -- field.  After something useful is done.  We must empty msg to
  62. -- reset ourselves for the next go around.
  63. --
  64. -- If the commandKey is up, we're safe.  Check if the msg box
  65. -- has been moved off the screen.  If it has, restore it to its
  66. -- original state.
  67. --
  68. -- Note that this technique interferes with command-M if the mouse
  69. -- is within the field
  70. On MouseWithin
  71.   global msgLoc,msgVis,msgContent
  72.   if the commandKey is down then
  73.     if the loc of msg <> "10,-100" then
  74.       put the loc of msg into msgLoc
  75.       put the visible of msg into msgVis
  76.       put msg into msgContent
  77.       set the loc of msg to 10,-100
  78.       put empty into msg
  79.     else
  80.       if msg <> empty then
  81.         put msg into card field result
  82.         put empty into msg
  83.       end if
  84.     end if
  85.   else
  86.     if the loc of msg is "10,-100" then
  87.       put msgContent into msg
  88.       set visible of msg to msgVis
  89.       set the loc of msg to msgLoc
  90.     end if
  91.   end if
  92. End MouseWithin
  93.  
  94. On Idle -- Don't forget this idle handler! It takes care of the case
  95.   -- of the user moving off the field while holding down the command
  96.   -- key.  Without this, the msg box would be "hung up"
  97.   global msgLoc,msgVis,msgContent
  98.   if (the commandKey is up) and (the loc of msg is "10,-100") then
  99.     put msgContent into msg
  100.     set visible of msg to msgVis
  101.     set the loc of msg to msgLoc
  102.   end if
  103.   pass Idle
  104. End Idle
  105.  
  106.  
  107.  
  108.  
  109. -- part contents for background part 4
  110. ----- text -----
  111. 2
  112.  
  113. -- part contents for background part 2
  114. ----- text -----
  115. Scrolling Text Button 2
  116.  
  117. -- part contents for background part 3
  118. ----- text -----
  119. COMMAND CLICK on any word in this script for an example of how this script works.
  120.  
  121. -- The BMUG/UNSOM trick by Guy Kuo and Raines Cohen - December 14,1987
  122. -- Use this script freely but please retain the above credit
  123. --
  124. -- The BMUG trick by Raines Cohen
  125. --         fused with the
  126. -- UNSOM technique by Guy Kuo
  127. --
  128. -- Recombinant code?  Script splicing?  Naw, just HyperCard letting
  129. -- ideas grow together.  Here is how this one works.
  130. --
  131. -- If the commandKey is down, we're in danger of doing a text button
  132. -- Check if the msg box has already been moved off the screen.
  133. -- If it hasnt hide the msg box by moving it off the screen and
  134. -- remember the old msg box location in MsgLoc
  135. -- the msg visibility in msgVis, and the msg in msgContent
  136. -- This allows us to restore things back to the way they were when
  137. -- we are done.
  138. -- If the msg box has been moved off the screen and msg is not
  139. -- empty, the user has command selected something and it is in msg
  140. -- do something with msg.  In this example we put it into another
  141. -- field.  After something useful is done.  We must empty msg to
  142. -- reset ourselves for the next go around.
  143. --
  144. -- If the commandKey is up, we're safe.  Check if the msg box
  145. -- has been moved off the screen.  If it has, restore it to its
  146. -- original state.
  147. --
  148. -- Note that this technique interferes with command-M if the mouse
  149. -- is within the field
  150. On MouseWithin
  151.   global msgLoc,msgVis,msgContent
  152.   if the commandKey is down then
  153.     if the loc of msg <> "10,-100" then
  154.       put the loc of msg into msgLoc
  155.       put the visible of msg into msgVis
  156.       put msg into msgContent
  157.       set the loc of msg to 10,-100
  158.       put empty into msg
  159.     else
  160.       if msg <> empty then
  161.         --
  162.         --msg now contains the selected word
  163.         --it's up to you to do something with it
  164.         --
  165.         put empty into msg
  166.       end if
  167.     end if
  168.   else
  169.     if the loc of msg is "10,-100" then
  170.       put msgContent into msg
  171.       set visible of msg to msgVis
  172.       set the loc of msg to msgLoc
  173.     end if
  174.   end if
  175. End MouseWithin
  176.  
  177. On Idle -- Don't forget this idle handler! It takes care of the case
  178.   -- of the user moving off the field while holding down the command
  179.   -- key.  Without this, the msg box would be "hung up"
  180.   global msgLoc,msgVis,msgContent
  181.   if (the commandKey is up) and (the loc of msg is "10,-100") then
  182.     put msgContent into msg
  183.     set visible of msg to msgVis
  184.     set the loc of msg to msgLoc
  185.   end if
  186.   pass Idle
  187. End Idle
  188.  
  189.  
  190.  
  191. -- part contents for card part 4
  192. ----- text -----
  193. COMMAND CLICK on any word in this script for an example of how this script works.
  194.  
  195. -- The BMUG/UNSOM trick by Guy Kuo and Raines Cohen - December 14,1987
  196. -- Use this script freely but please retain the above credit
  197. --
  198. -- The BMUG trick by Raines Cohen
  199. --         fused with the
  200. -- UNSOM technique by Guy Kuo
  201. --
  202. -- Recombinant code?  Script splicing?  Naw, just HyperCard letting
  203. -- ideas grow together.  Here is how this one works.
  204. --
  205. -- If the commandKey is down, we're in danger of doing a text button
  206. -- Check if the msg box has already been moved off the screen.
  207. -- If it hasnt hide the msg box by moving it off the screen and
  208. -- remember the old msg box location in MsgLoc
  209. -- the msg visibility in msgVis, and the msg in msgContent
  210. -- This allows us to restore things back to the way they were when
  211. -- we are done.
  212. -- If the msg box has been moved off the screen and msg is not
  213. -- empty, the user has command selected something and it is in msg
  214. -- do something with msg.  In this example we put it into another
  215. -- field.  After something useful is done.  We must empty msg to
  216. -- reset ourselves for the next go around.
  217. --
  218. -- If the commandKey is up, we're safe.  Check if the msg box
  219. -- has been moved off the screen.  If it has, restore it to its
  220. -- original state.
  221. --
  222. -- Note that this technique interferes with command-M if the mouse
  223. -- is within the field
  224. On MouseWithin
  225.   global msgLoc,msgVis,msgContent
  226.   if the commandKey is down then
  227.     if the loc of msg <> "10,-100" then
  228.       put the loc of msg into msgLoc
  229.       put the visible of msg into msgVis
  230.       put msg into msgContent
  231.       set the loc of msg to 10,-100
  232.       put empty into msg
  233.     else
  234.       if msg <> empty then
  235.         --
  236.         --msg now contains the selected word
  237.         --it's up to you to do something with it
  238.         --
  239.         put empty into msg
  240.       end if
  241.     end if
  242.   else
  243.     if the loc of msg is "10,-100" then
  244.       put msgContent into msg
  245.       set visible of msg to msgVis
  246.       set the loc of msg to msgLoc
  247.     end if
  248.   end if
  249. End MouseWithin
  250.  
  251. On Idle -- Don't forget this idle handler! It takes care of the case
  252.   -- of the user moving off the field while holding down the command
  253.   -- key.  Without this, the msg box would be "hung up"
  254.   global msgLoc,msgVis,msgContent
  255.   if (the commandKey is up) and (the loc of msg is "10,-100") then
  256.     put msgContent into msg
  257.     set visible of msg to msgVis
  258.     set the loc of msg to msgLoc
  259.   end if
  260.   pass Idle
  261. End Idle
  262.  
  263.